package com.zrrd.javaSEPlus._05_annotation;

import java.lang.annotation.*;

/**
 * @author WanJl
 * @version 1.0
 * @title AnnotationDemo05
 * @description
 * @create 2023/11/19 9:27
 */
@Target({ElementType.TYPE,ElementType.FIELD,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited //指定该注解可以被继承
public @interface AnnotationDemo05 {

}


@AnnotationDemo05
class Person01{

}

class Student extends Person01{
    public void method(){
        System.out.println("student......的方法......");
    }
}

class StudentDemo{
    public static void main(String[] args) throws ClassNotFoundException {
        Class<?> clazz = Class.forName("com.zrrd.javaSEPlus._05_annotation.Student");
        boolean annotationPresent = clazz.isAnnotationPresent(AnnotationDemo05.class);
        System.out.println(annotationPresent);

    }
}






















